(function(){var positionIds=['BACKGROUND_adagioadv','WIDELEADERBOARD1_adagioadv','WIDELEADERBOARD2_adagioadv','HALFPAGE1_adagioadv','HALFPAGE2_adagioadv'];adagioNOPrint=true; /**fmt_edidomus_async - v. 2.2 */ if (positionIds.length > 1){ _edidomus.divIdToScale = []; _edidomus.mapContainerWidth = new Map(); _edidomus.mapContentContainer = new Map(); for (var i = 0; i < positionIds.length; i++) { if (document.getElementById(positionIds[i]) !== null) { _edidomus.mapContainerWidth.set(positionIds[i], document.getElementById(positionIds[i]).clientWidth); } } } adagioNOPrint = true; var hostname = document.location.hostname; _edidomus.isScaleToApply = (hostname === "staging.quattroruote.it" || hostname === "www.quattroruote.it"); adagioNOPrint = true; var adagioBCode = '', adagioFormatIndex = 0, async = false, formatAppend = true; var isMpopOverlay = false; // ISTR_ADD var isPopOverlay = false; adagioBCode = ''; adagioContentId = ''; try { /*background*/ isMpopOverlay = isMpopOverlay || ("background" == "mpopoverlay"); // ISTR_ADD isPopOverlay = isPopOverlay || ("background" == "popoverlay"); // ISTR_ADD async = false; formatAppend = true; try{ if ("background" != "background"){ document.getElementById(positionIds[adagioFormatIndex]).innerHTML = ""; } } catch(e){} var str = location.href; var patt = new RegExp("//www.montagna.tv/"); var resAutoU = patt.test(str); if(resAutoU) document.getElementById("wrapper").style.marginTop="0px"; if (adagioContentId != ''){ _edidomus.mapContentContainer.set(adagioContentId, positionIds[adagioFormatIndex]); _edidomus.divIdToScale.push(adagioContentId); } }catch(e){console.log("ce "+positionIds[adagioFormatIndex] + " A");} try { if ((positionIds[adagioFormatIndex] != "@BODY") && formatAppend){ if(typeof(async)!='undefined' && async) document.getElementById(positionIds[adagioFormatIndex]).appendChild(adagioBCode); else{ document.getElementById(positionIds[adagioFormatIndex]).innerHTML += adagioBCode; } } }catch(e){ console.log("ce: "+positionIds[adagioFormatIndex] + " B");} adagioFormatIndex++; adagioBCode = ''; adagioContentId = ''; try { /*wideleaderboard1*/ isMpopOverlay = isMpopOverlay || ("wideleaderboard1" == "mpopoverlay"); // ISTR_ADD isPopOverlay = isPopOverlay || ("wideleaderboard1" == "popoverlay"); // ISTR_ADD async = false; formatAppend = true; try{ if ("wideleaderboard1" != "background"){ document.getElementById(positionIds[adagioFormatIndex]).innerHTML = ""; } } catch(e){} /** * Redirect JS CloudFront * v. 1.0 * 619877 */ var adagioBCode = '', adagioContentId = "adagioIframeJs_619877_1714788993081", width = "970", height = "250", site = "dueruote.it"; scriptId = "79100"; isTrueAsync = true; window.adCreateFriendlyIF = function(objNameParam){ var objName = objNameParam; this.createFI = function(ifr, ifr_id, width, height) { ifr = (ifr ? ifr : document).createElement("iframe"); ifr_id && ifr.setAttribute("id", ifr_id); ifr.style.display = width ? "" : "none"; ifr.style.width = width ? width + "px" : "0px"; ifr.style.height = height ? height + "px" : "0px"; ifr.style.position = "relative"; ifr.style.margin = "0 auto"; document.documentMode && 8 > document.documentMode ? (ifr.frameBorder = 0, ifr.margin = 0, ifr.marginWidth = 0, ifr.marginHeight = 0, ifr.scrolling = "no") : (ifr.setAttribute("scrolling", "no"), ifr.setAttribute("marginwidth", "0"), ifr.setAttribute("marginheight", "0"), ifr.setAttribute("frameborder", "0")); return ifr; }; this.enableIframeReady = function(ifr) { if (ifr) { ifr.setAttribute("ready-to-write", "false"); var src = "javascript:document.write('" + "\r" + ('try{' + 'parent.document.domain;' + '}catch(e){' + 'document.domain="' + document.domain + '";}\r') + "parent."+objName+".callbackFI(window);\r" + "\r');"; ifr.src = src; } }; this.callbackFI = function(elem) { for (var b = document.getElementsByTagName("iframe"), c = 0; c < b.length; c++) try { if ((b[c].contentWindow || b[c].contentDocument.window || b[c].window) == elem) { b[c].setAttribute("ready-to-write", "true"); break; } } catch (d) {} }; this.writeToFI = function(ifr, code) { if (document.documentMode && 7 < document.documentMode && "false" == ifr.getAttribute("ready-to-write")) setTimeout(function() { writeToFI(ifr, code, c); }, 100); else { var d = ifr.contentWindow ? ifr.contentWindow.document : ifr.contentDocument && ifr.contentDocument.document ? ifr.contentDocument.document : ifr.contentDocument; d.write("

" + "inDapIF = true;"+ code); setTimeout(function() { d.close(); }, 1000); } }; }; var createIframe = function (id, code, width, height, id_parent) { var ifrm = document.createElement('iframe'); ifrm.id = id; var attrs = {"frameborder":"0","scrolling":"no","width":width,"height":height,"marginwidth":"0","marginheight":"0","vspace":"0","hspace":"0"}; for (var key in attrs){ ifrm.setAttribute(key, attrs[key]); } ifrm.src = "JavaScript:''"; document.getElementById(id_parent).appendChild(ifrm); setTimeout(function(){ ifrm = document.getElementById(id); ifrm.contentWindow.document.open('text/html', 'replace'); ifrm.contentWindow.document.write(code); ifrm.contentWindow.document.close(); },500); }; var getTrackImpressionUrl = function(){ if (''!='') return ''.replace("//","//"); if (''!='') return ''.replace("//","//"); if(''!='') return ''.replace("//","//"); if(''!='') return ''.replace("//","//"); if(''!='') return ''.replace("//","//"); if (''!='') return ''.replace("//","//"); if(''!='') return ''.replace("//","//"); if(''!='') return ''.replace("//","//"); if(''!='') return ''.replace("//","//"); if(''!='') return ''.replace("//","//"); if(''!='') return ''.replace("//","//"); if(''!='') return ''.replace("//","//"); if(''!='') return ''.replace("//","//"); return ""; }; var setConfirmCode = function(){ var confirm = ''.replace("//","//"); return '
'+confirm+'
'; }; var getTrackFirstQuartile = function(){ return ''; }; adagioBCode+= '
'; //'; adagioBCode += getTrackFirstQuartile(); adagioBCode += setConfirmCode(); if (getTrackImpressionUrl() != "") adagioBCode+=''; if (typeof(adagioNOPrint) == "undefined" || adagioNOPrint==null || adagioNOPrint == false) { document.write(adagioBCode); } else if (typeof positionIds !== "undefined"){ document.getElementById(positionIds[adagioFormatIndex]).innerHTML = adagioBCode; adagioBCode = ""; } else{ isTrueAsync = false; } try{ if (document.getElementById(adagioContentId).parentNode.parentNode.className == "genericBanner section"){ document.getElementById(adagioContentId).parentNode.parentNode.style.height="auto"; } } catch(e){} var code = "

" + "inDapIF = true;" + "" + "var aplus_clickurl = '//adagiofe.neodatagroup.com/ad/clk.jsp?x=422671.619877.1063.854419.-1.device_desktop^gdpr_0.37.88.1.1877.1.-1.-1.-1..-1.0...&link='; " + "var aplus_referrer = '" + site + "';" + "var aplus_resize_parent_tag = true;" + "" + ""; var jsCode = function(){ window.adObj_redir_619877_1714788993081 = new window.adCreateFriendlyIF("adObj_redir_619877_1714788993081"); var ifr = adObj_redir_619877_1714788993081.createFI(false,"ifr_"+adagioContentId,width,height); document.getElementById(adagioContentId).appendChild(ifr); adObj_redir_619877_1714788993081.enableIframeReady(ifr); adObj_redir_619877_1714788993081.writeToFI(ifr, code); }; if (!isTrueAsync){ setTimeout(function(){ jsCode(); },1000); } else{ jsCode(); } formatAppend = false; window.adagioAppendInAsync = function(id,src,type){ // todo aggiungere alla lib if(document.getElementById(id) != null){ switch (type){ case "script": var s = document.createElement("script"); s.type = "text/javascript"; s.src = src; document.getElementById(id).appendChild(s); break; default: break; } } else{ setTimeout(function(){ adagioAppendInAsync(id, src, type); },250); } }; window.adagioAppendInAsync(adagioContentId, "", "script"); function waitForElement_619877(adagioContentId){ if(document.getElementById(adagioContentId) != null){ objName=window.activeCheckViewability(619877, 422671, 854419, 50, 1, 88, adagioContentId); } else{ setTimeout(function(){ waitForElement_619877(adagioContentId); },250); } } waitForElement_619877(adagioContentId); if (adagioContentId != ''){ _edidomus.mapContentContainer.set(adagioContentId, positionIds[adagioFormatIndex]); _edidomus.divIdToScale.push(adagioContentId); } }catch(e){console.log("ce "+positionIds[adagioFormatIndex] + " A");} try { if ((positionIds[adagioFormatIndex] != "@BODY") && formatAppend){ if(typeof(async)!='undefined' && async) document.getElementById(positionIds[adagioFormatIndex]).appendChild(adagioBCode); else{ document.getElementById(positionIds[adagioFormatIndex]).innerHTML += adagioBCode; } } }catch(e){ console.log("ce: "+positionIds[adagioFormatIndex] + " B");} adagioFormatIndex++; adagioBCode = ''; adagioContentId = ''; try { /*wideleaderboard2*/ isMpopOverlay = isMpopOverlay || ("wideleaderboard2" == "mpopoverlay"); // ISTR_ADD isPopOverlay = isPopOverlay || ("wideleaderboard2" == "popoverlay"); // ISTR_ADD async = false; formatAppend = true; try{ if ("wideleaderboard2" != "background"){ document.getElementById(positionIds[adagioFormatIndex]).innerHTML = ""; } } catch(e){} if (adagioContentId != ''){ _edidomus.mapContentContainer.set(adagioContentId, positionIds[adagioFormatIndex]); _edidomus.divIdToScale.push(adagioContentId); } }catch(e){console.log("ce "+positionIds[adagioFormatIndex] + " A");} try { if ((positionIds[adagioFormatIndex] != "@BODY") && formatAppend){ if(typeof(async)!='undefined' && async) document.getElementById(positionIds[adagioFormatIndex]).appendChild(adagioBCode); else{ document.getElementById(positionIds[adagioFormatIndex]).innerHTML += adagioBCode; } } }catch(e){ console.log("ce: "+positionIds[adagioFormatIndex] + " B");} adagioFormatIndex++; adagioBCode = ''; adagioContentId = ''; try { /*halfpage1*/ isMpopOverlay = isMpopOverlay || ("halfpage1" == "mpopoverlay"); // ISTR_ADD isPopOverlay = isPopOverlay || ("halfpage1" == "popoverlay"); // ISTR_ADD async = false; formatAppend = true; try{ if ("halfpage1" != "background"){ document.getElementById(positionIds[adagioFormatIndex]).innerHTML = ""; } } catch(e){} /** * Redirect JS CloudFront * v. 1.0 * 619874 */ var adagioBCode = '', adagioContentId = "adagioIframeJs_619874_1714788993083", width = "300", height = "250", site = "dueruote.it"; scriptId = "79099"; isTrueAsync = true; window.adCreateFriendlyIF = function(objNameParam){ var objName = objNameParam; this.createFI = function(ifr, ifr_id, width, height) { ifr = (ifr ? ifr : document).createElement("iframe"); ifr_id && ifr.setAttribute("id", ifr_id); ifr.style.display = width ? "" : "none"; ifr.style.width = width ? width + "px" : "0px"; ifr.style.height = height ? height + "px" : "0px"; ifr.style.position = "relative"; ifr.style.margin = "0 auto"; document.documentMode && 8 > document.documentMode ? (ifr.frameBorder = 0, ifr.margin = 0, ifr.marginWidth = 0, ifr.marginHeight = 0, ifr.scrolling = "no") : (ifr.setAttribute("scrolling", "no"), ifr.setAttribute("marginwidth", "0"), ifr.setAttribute("marginheight", "0"), ifr.setAttribute("frameborder", "0")); return ifr; }; this.enableIframeReady = function(ifr) { if (ifr) { ifr.setAttribute("ready-to-write", "false"); var src = "javascript:document.write('" + "\r" + ('try{' + 'parent.document.domain;' + '}catch(e){' + 'document.domain="' + document.domain + '";}\r') + "parent."+objName+".callbackFI(window);\r" + "\r');"; ifr.src = src; } }; this.callbackFI = function(elem) { for (var b = document.getElementsByTagName("iframe"), c = 0; c < b.length; c++) try { if ((b[c].contentWindow || b[c].contentDocument.window || b[c].window) == elem) { b[c].setAttribute("ready-to-write", "true"); break; } } catch (d) {} }; this.writeToFI = function(ifr, code) { if (document.documentMode && 7 < document.documentMode && "false" == ifr.getAttribute("ready-to-write")) setTimeout(function() { writeToFI(ifr, code, c); }, 100); else { var d = ifr.contentWindow ? ifr.contentWindow.document : ifr.contentDocument && ifr.contentDocument.document ? ifr.contentDocument.document : ifr.contentDocument; d.write("

" + "inDapIF = true;"+ code); setTimeout(function() { d.close(); }, 1000); } }; }; var createIframe = function (id, code, width, height, id_parent) { var ifrm = document.createElement('iframe'); ifrm.id = id; var attrs = {"frameborder":"0","scrolling":"no","width":width,"height":height,"marginwidth":"0","marginheight":"0","vspace":"0","hspace":"0"}; for (var key in attrs){ ifrm.setAttribute(key, attrs[key]); } ifrm.src = "JavaScript:''"; document.getElementById(id_parent).appendChild(ifrm); setTimeout(function(){ ifrm = document.getElementById(id); ifrm.contentWindow.document.open('text/html', 'replace'); ifrm.contentWindow.document.write(code); ifrm.contentWindow.document.close(); },500); }; var getTrackImpressionUrl = function(){ if (''!='') return ''.replace("//","//"); if (''!='') return ''.replace("//","//"); if(''!='') return ''.replace("//","//"); if(''!='') return ''.replace("//","//"); if(''!='') return ''.replace("//","//"); if (''!='') return ''.replace("//","//"); if(''!='') return ''.replace("//","//"); if(''!='') return ''.replace("//","//"); if(''!='') return ''.replace("//","//"); if(''!='') return ''.replace("//","//"); if(''!='') return ''.replace("//","//"); if(''!='') return ''.replace("//","//"); if(''!='') return ''.replace("//","//"); return ""; }; var setConfirmCode = function(){ var confirm = ''.replace("//","//"); return '
'+confirm+'
'; }; var getTrackFirstQuartile = function(){ return ''; }; adagioBCode+= '
'; //'; adagioBCode += getTrackFirstQuartile(); adagioBCode += setConfirmCode(); if (getTrackImpressionUrl() != "") adagioBCode+=''; if (typeof(adagioNOPrint) == "undefined" || adagioNOPrint==null || adagioNOPrint == false) { document.write(adagioBCode); } else if (typeof positionIds !== "undefined"){ document.getElementById(positionIds[adagioFormatIndex]).innerHTML = adagioBCode; adagioBCode = ""; } else{ isTrueAsync = false; } try{ if (document.getElementById(adagioContentId).parentNode.parentNode.className == "genericBanner section"){ document.getElementById(adagioContentId).parentNode.parentNode.style.height="auto"; } } catch(e){} var code = "

" + "inDapIF = true;" + "" + "var aplus_clickurl = '//adagiofe.neodatagroup.com/ad/clk.jsp?x=422667.619874.1063.854423.-1.device_desktop^gdpr_0.37.88.1.1728.1.-1.-1.-1..-1.0...&link='; " + "var aplus_referrer = '" + site + "';" + "var aplus_resize_parent_tag = true;" + "" + ""; var jsCode = function(){ window.adObj_redir_619874_1714788993083 = new window.adCreateFriendlyIF("adObj_redir_619874_1714788993083"); var ifr = adObj_redir_619874_1714788993083.createFI(false,"ifr_"+adagioContentId,width,height); document.getElementById(adagioContentId).appendChild(ifr); adObj_redir_619874_1714788993083.enableIframeReady(ifr); adObj_redir_619874_1714788993083.writeToFI(ifr, code); }; if (!isTrueAsync){ setTimeout(function(){ jsCode(); },1000); } else{ jsCode(); } formatAppend = false; window.adagioAppendInAsync = function(id,src,type){ // todo aggiungere alla lib if(document.getElementById(id) != null){ switch (type){ case "script": var s = document.createElement("script"); s.type = "text/javascript"; s.src = src; document.getElementById(id).appendChild(s); break; default: break; } } else{ setTimeout(function(){ adagioAppendInAsync(id, src, type); },250); } }; window.adagioAppendInAsync(adagioContentId, "", "script"); function waitForElement_619874(adagioContentId){ if(document.getElementById(adagioContentId) != null){ objName=window.activeCheckViewability(619874, 422667, 854423, 50, 1, 88, adagioContentId); } else{ setTimeout(function(){ waitForElement_619874(adagioContentId); },250); } } waitForElement_619874(adagioContentId); if (adagioContentId != ''){ _edidomus.mapContentContainer.set(adagioContentId, positionIds[adagioFormatIndex]); _edidomus.divIdToScale.push(adagioContentId); } }catch(e){console.log("ce "+positionIds[adagioFormatIndex] + " A");} try { if ((positionIds[adagioFormatIndex] != "@BODY") && formatAppend){ if(typeof(async)!='undefined' && async) document.getElementById(positionIds[adagioFormatIndex]).appendChild(adagioBCode); else{ document.getElementById(positionIds[adagioFormatIndex]).innerHTML += adagioBCode; } } }catch(e){ console.log("ce: "+positionIds[adagioFormatIndex] + " B");} adagioFormatIndex++; adagioBCode = ''; adagioContentId = ''; try { /*halfpage2*/ isMpopOverlay = isMpopOverlay || ("halfpage2" == "mpopoverlay"); // ISTR_ADD isPopOverlay = isPopOverlay || ("halfpage2" == "popoverlay"); // ISTR_ADD async = false; formatAppend = true; try{ if ("halfpage2" != "background"){ document.getElementById(positionIds[adagioFormatIndex]).innerHTML = ""; } } catch(e){} if (adagioContentId != ''){ _edidomus.mapContentContainer.set(adagioContentId, positionIds[adagioFormatIndex]); _edidomus.divIdToScale.push(adagioContentId); } }catch(e){console.log("ce "+positionIds[adagioFormatIndex] + " A");} try { if ((positionIds[adagioFormatIndex] != "@BODY") && formatAppend){ if(typeof(async)!='undefined' && async) document.getElementById(positionIds[adagioFormatIndex]).appendChild(adagioBCode); else{ document.getElementById(positionIds[adagioFormatIndex]).innerHTML += adagioBCode; } } }catch(e){ console.log("ce: "+positionIds[adagioFormatIndex] + " B");} adagioFormatIndex++; if(!isMpopOverlay && !isPopOverlay){ // ISTR_ADD var event = document.createEvent("Event"); event.initEvent('noAdvMpopoverlay',true,false); document.dispatchEvent(event); } if (_edidomus.isScaleToApply && positionIds.length > 1){ _edidomus.applyScale(); window.addEventListener("resize", _edidomus.scalingResizeHandler); } })()